﻿using Microsoft.Extensions.DependencyInjection;
using MyVideoPlayer.Services;
using System.Configuration;
using System.Data;
using System.Windows;

namespace MyVideoPlayer
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public static IServiceProvider Services { get; private set; } = null!;

        protected override void OnStartup(StartupEventArgs e)
        {
            // 创建服务集合
            var services = new ServiceCollection();
            //  调用扩展方法注册服务
            services.AddServices();
            //  构建服务提供者
            Services = services.BuildServiceProvider();

            base.OnStartup(e);
        }
    }

}
